﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;

namespace Microsoft.WVB.Framework
{
    /// <summary>
    /// A class which gathers all necessary information for displaying an Ad.
    /// </summary>
    public class AdContext
    {
        /// <summary>
        /// The timecode represented as a unique key for a given Ad display.
        /// </summary>
        public TimeSpan id
        {
            get
            {
                return _id;
            }
        }
        private TimeSpan _id;

        /// <summary>
        /// The public contructor for an AdContext class
        /// </summary>
        /// <param name="uniqueTimecode"></param>
        public AdContext(TimeSpan uniqueTimecode)
        {
            _id = uniqueTimecode;
            IsProvisioned = false;
        }

        /// <summary>
        /// A string array containing all Ad keyowrds tagged into the Video during content preparation
        /// </summary>
        public String AdKeywords { get; set; }

        /// <summary>
        /// Informs about the container receiving the Ad content. i.e an image might need to be displayed
        /// in the Video and in the banner (especialy since banner are not shown during fullscreen)
        /// Banner,
        /// Overlay
        /// </summary>
        public AdVisual EligibleContainer { get; set; }

        /// <summary>
        /// When Overlayed, we need to know where to Overlay it
        /// NotApplicable,
        /// TopOverlayed,
        /// BottomOverlayed,
        /// Pip,
        /// Inline
        /// </summary>
        public AdOverlayMode DisplayRegion { get; set; }

        /// <summary>
        /// the type of Format for the Ad. this will help finding out if the Ad container should be
        /// a MediaElement, an Image or a ContentPresenter
        /// Video,
        /// Image,
        /// Flash,
        /// Html,
        /// Xaml
        /// </summary>
        public AdFormat Format { get; set; }

        /// <summary>
        /// Uri of the Ad source
        /// </summary>
        public Uri Source { get; set; }

        /// <summary>
        /// Uri of the resource that the broswer needs to navigate when the user clicks the Ad
        /// </summary>
        public Uri Click { get; set; }

        /// <summary>
        /// Uri to call back when the Ad is first viewed
        /// </summary>
        public Uri ImpressionCallback { get; set; }

        /// <summary>
        /// Uri to call back when the user has seen half of the Ad duration
        /// </summary>
        public Uri MidCallback { get; set; }

        /// <summary>
        /// Uri to call back when the user has seen the entire Ad duration
        /// </summary>
        public Uri EndCallback { get; set; }

        /// <summary>
        /// Uri of a 3rd party to call back when the Ad is first viewed
        /// </summary>
        public Uri ThrdImpressionCallback { get; set; }

        /// <summary>
        /// Uri of a 3rd party to call back when the user has seen half of the Ad duration
        /// </summary>
        public Uri ThrdMidCallback { get; set; }

        /// <summary>
        /// Uri of a 3rd party to call back when the user has seen the entire Ad duration
        /// </summary>
        public Uri ThrdEndCallback { get; set; }

        /// <summary>
        /// if not a Video, the duration of the Ad display
        /// </summary>
        public TimeSpan Duration { get; set; }

        /// <summary>
        /// if a Video, inform the AdManager if the user can skip or Move forward the Video
        /// </summary>
        public Boolean CanSkip { get; set; }

        /// <summary>
        /// Since all operations to Ad Service back-end is done Asynchronously, we need to know
        /// if the provisioning for this context is finished or not, otherwise the Ad won't be 
        /// processed.
        /// </summary>
        public Boolean IsProvisioned { get; set; }
    }
}
